import { http } from "@/utils/http/axios";

const baseProfix = "resource/oss";
/**
 * 获取文件列表
 * @returns
 */
export function getPageList(params = {}) {
	return http.request<API.Response.BasicResponse>(
		{
			url: `${baseProfix}/page`,
			method: "get",
			params
		},
		{
			isTransformResponse: false
		}
	);
}
export function upload(data = {} as FormData) {
	return http.uploadFile<any>({
		url: `${baseProfix}/upload`,
		method: "POST",
		data: data
	});
}
/**
 * 根据ID查询
 * @returns
 */
export function getInfo(id: number) {
	return http.request<API.Response.BasicResponse>(
		{
			url: `${baseProfix}/listByIds/${id}`,
			method: "get"
		},
		{
			isTransformResponse: false
		}
	);
}
/**
 * 删除文件
 * @returns
 */
export function remove(id: number | Array<number>) {
	return http.request<API.Response.BasicResponse>(
		{
			url: `${baseProfix}/${id}`,
			method: "DELETE"
		},
		{
			isTransformResponse: false
		}
	);
}
